package model;

import network.Device;
import network.Port;
import org.jgrapht.Graph;
import org.jgrapht.graph.DefaultDirectedGraph;

import java.util.HashSet;

public class DeltaForwardingGraph {
    public Graph<Device, LabeledEdge> graph;
    public HashSet<Integer> transferredPreds;

    /**
     * A deltaForwardingGraph is a subset of Network Model. Based on a set of updated predicates
     * and its corresponding Network Model, it consists of a subset of devices holding at least
     * one port with updated predicate, the peering devices of those ports and corresponding edges.
     *
     * @param transferredPreds the set of predicates affected by update
     * @param model the updated network model
     */
    public DeltaForwardingGraph(Model model, HashSet<Integer> transferredPreds) {
        this.graph = new DefaultDirectedGraph<>(LabeledEdge.class);
        this.transferredPreds = transferredPreds; // TODO: clone? consider concurrency!
    }
}